package com.weilele.leisure.time.ui.holder


import android.view.View
import com.weilele.leisure.time.databinding.HolderSingleTextBinding
import com.weilele.mvvm.adapter.MvvmHolder
import com.weilele.mvvm.adapter.mvvmRcvAdapter
import com.weilele.mvvm.utils.activity.textFrom

class SingleTextHolder : MvvmHolder<String, HolderSingleTextBinding> {
    companion object {
        fun toAdapter() = mvvmRcvAdapter(SingleTextHolder::class.java,
            { old, new -> old == new },
            { old, new -> old == new })
    }

    constructor(binding: HolderSingleTextBinding) : super(binding)
    constructor(itemView: View) : super(itemView)

    override fun bindData(data: String) {
        mBinding.root.textFrom(data)
    }
}